package cn.idietrade.idietradegoodsmodule8002.mapper;

import cn.idietrade.common.pojo.SecondShoppingCart;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface SecondShoppingCartMapper {
    //通过登录用户id查询当前用户的购物车
    List<SecondShoppingCart> queryShoppingCartUId(@Param("userId") Integer userId,@Param("goodsId")Integer goodsId);

    //删除购物车商品
    int deleShoppingGoods(@Param("userId")Integer userId,@Param("goodsId")Integer goodsId);

    //商品加入购物车
    int addShoppingGoods(@Param("userId")Integer userId,@Param("goodsId")Integer goodsId);
    int updateAddShoppingGoods(@Param("userId")Integer userId,@Param("goodsId")Integer goodsId);

    //添加购物车前判断该商品是否存在
    int selectOneShoppingGoods(@Param("userId")Integer userId,@Param("goodsId")Integer goodsId);

    //修改购物车数量
    int updateShoppingCart(@Param("userId")Integer userId,@Param("goodsId") Integer goodsId,@Param("num") Integer num);


}
